/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ez2find.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author Owner
 */
@NamedQueries(value={@NamedQuery(name="listAllHousPrices", query="SELECT hp FROM HousPrice hp" ),  
                     @NamedQuery(name="priceSiteHousCategorie", query="SELECT hp.price FROM HousPrice hp WHERE hp.site=:site AND hp.housCategorie=:housCategorie")})
                     
@Entity
public class HousPrice implements Serializable{
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private long id;
    @ManyToOne()
    private Site site;
    @ManyToOne()
    private CategoriaInmobiliario housCategorie;
    private double price;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Site getSite() {
        return site;
    }

    public void setSite(Site site) {
        this.site = site;
    }

    public CategoriaInmobiliario getHousCategorie() {
        return housCategorie;
    }

    public void setHousCategorie(CategoriaInmobiliario housCategorie) {
        this.housCategorie = housCategorie;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    
}
